<?php
import("@.ORG.Dir");
/**
 * 数据操作moxing
 * 用户对数据库进行备份、恢复， 缓存的管理操作
 * @author Code.404
 *
 */
class DataManagerModel extends Model{
	/**
	 * 清理数据缓存
	 * Enter description here ...
	 */
	function clearDataCache(){
		if(IS_SAE){
			throw_exception(L("CURRENT_NOT_SUPPORT_SAE"));
		}else{
			try{
				@Dir::del ( "././App/Runtime/Data/" );
				@Dir::del ( "././App/Runtime/Data/_fields/" );
			}catch (Exception $e){
				throw_exception(L('ACTION_FAILED'));
			}
		}
		
	}
	/**
	 * 清理页面缓存
	 * Enter description here ...
	 */
	function clearPageCache(){
		if(IS_SAE){
			throw_exception(L("CURRENT_NOT_SUPPORT_SAE"));
		}else{
			try{
				@Dir::del ( '././App/Runtime/Temp' );
	
				@Dir::del ( "././App/Runtime/Cache/" );
				@Dir::del ( "././App/Runtime/Cache/Admin/" );
				@Dir::del ( "././App/Runtime/Cache/Home/" );
				@Dir::del ( "././App/Runtime/Temp/" );
			}catch (Exception $e){
				throw_exception(L('ACTION_FAILED'));
			}
		}
	}
}